﻿using System;
using XSTDZ.ERP.Application.DataContracts;
using System.Collections.Generic;

namespace XSTDZ.ERP.Application
{
    /// <summary>
    /// 损溢报告服务
    /// </summary>
    public interface IProfitAndLossBillService
    {
        #region 损溢报告订单
        /// <summary>
        /// 添加损溢报告任务单据
        /// </summary>
        /// <param name="profitAndLossBillDto"></param>
        Guid AddProfitAndLossBill(ProfitAndLossBillDto profitAndLossBillDto);
        /// <summary>
        /// 添加损溢报告任务单据
        /// </summary>
        /// <param name="profitAndLossBillDto"></param>
        Guid AddProfitAndLossBill(ProfitAndLossBillDto profitAndLossBillDto, IEnumerable<ProfitAndLossBillDetailDto> profitAndLossBillDetailDtos);
        /// <summary>
        /// 添加损溢报告任务单据
        /// </summary>
        /// <param name="profitAndLossBillDto"></param>
        Guid AddProfitAndLossBill(Guid profitAndLossBillId, IEnumerable<ProfitAndLossBillDetailDto> profitAndLossBillDetailDtos);
        void UpdateProfitAndLossBill(ProfitAndLossBillDto profitAndLossBillDto);
        void UpdateProfitAndLossBill(Guid profitAndLossBillId, IEnumerable<ProfitAndLossBillDetailDto> profitAndLossBillDetailDtos);
        void UpdateProfitAndLossBill(ProfitAndLossBillDto profitAndLossBillDto, IEnumerable<ProfitAndLossBillDetailDto> profitAndLossBillDetailDtos);

        void ConvertProfitAndLossBillDeleteState(Guid profitAndLossBillId);
        void ConvertProfitAndLossBillDeleteState(Guid profitAndLossBillId, IEnumerable<Guid> profitAndLossBillDetailIds);

        ProfitAndLossBillDto GetProfitAndLossBill(Guid profitAndLossBillId);
        IEnumerable<ProfitAndLossBillDto> GetProfitAndLossBills(int pageIndex, int pageSize);

        //把生成的盘点单数据更新至库存，会影响库存
        void UpdateToStock(Guid profitAndLossBillId, IEnumerable<Guid> profitAndLossBillDetailIds);
        //审核
        void Audit(Guid profitAndLossBillId, Guid UserID,bool isOk);
        //提交
        void Confirm(Guid profitAndLossBillId, Guid UserID);
        
        #endregion
        #region 损溢报告订单明细
        void AddProfitAndLossBillDetail(Guid productInBillId, ProfitAndLossBillDetailDto productCheckBillDetailDto);
        void UpdateProfitAndLossBillDetail(Guid productInBillId, IEnumerable<ProfitAndLossBillDetailDto> profitAndLossBillDetailDtos);
        ProfitAndLossBillDetailDto GetProfitAndLossBillDetail(Guid productCheckBillDetailId);
        IEnumerable<ProfitAndLossBillDetailDto> GetProfitAndLossBillDetails(Guid profitAndLossBillId);

        #endregion
        #region 其它
        /// <summary>
        /// 获得当前损溢报告单单号的最大单号
        /// </summary>
        /// <returns></returns>
        string GetMaxBillNo();
        #endregion
    }
}
